package mhl.service;

import mhl.dao.MenuDAO;
import mhl.domain.Menu;

import java.util.List;

/**
 * @author DCSGO
 * @version 1.0
 */
public class MenuService {
    private final MenuDAO menuDAO = new MenuDAO();

    public List<Menu> getAll() {
        String sql = "select * from menu";
        return menuDAO.queryMulti(sql, Menu.class);
    }

    public Menu getMenuById(int id) {
        String sql = "select * from menu where id = ?";
        return menuDAO.querySingle(sql, Menu.class, id);
    }
}
